<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app->get( '/', function () use ( $app ) {
    return $app->version();
} );

// Github 自动部署
$app->post('deploy', 'DeployController@github');

$app->get( 'wechat', 'Wechat\Controller@serve' );
$app->post( 'wechat', 'Wechat\Controller@serve' );

/**
 * 网页 注册(绑定)
 */
$app->get( 'register/{openid}', [
    'as' => 'register',
    function () {
        return view( 'wechat.register' );
    }
] );

/**
 * 接口 注册(绑定)数据提交地址
 */
$app->post( 'register', 'Wechat\UserController@register' );

/**
 * 网页 期末成绩获取
 */
$app->get( 'scores/{type}/{openid}', 'Wechat\Plugins\Education@scoresHtml' );

/**
 * 创建微信自定义菜单
 */
$app->get( 'menu/add', 'Wechat\Menu@add' );


/**
 * 快递动态推送
 */
$app->get( 'send/express', 'Wechat\Send\SendExpressNoticeController@send' );

/**
 * 上传图片
 */
$app->get( 'upload/material/image', 'Wechat\Upload\UploadMaterialController@image' );


/**
 * 微信回调
 */
$app->get( 'wechat_oauth_callback', 'CallbackController@common');

/**
 * 网页 快递查询
 */
$app->get( 'query/express', 'Wechat\Plugins\ExpressTracking@expressHtml' );

/**
 * 网页 快递查询结果
 */
$app->post( 'query/express/result', 'Wechat\Plugins\ExpressTracking@expressPost' );

/**
 * 网页 四六级查询
 */
$app->get( 'query/cet', 'Wechat\Plugins\CetScore@cetPost' );

